#!/usr/bin/python

import pygame


# Base class for an entity effect
class Effect(object):

    # Obvious
    def __init__(self, name, targetEntity):
        self.m_name=name
        self.m_targetEntity=targetEntity

    # Get name
    def getName(self):
        return self.m_name

    # Get target entity
    def getTargetEntity(self):
        return self.m_targetEntity

    # Set target entity
    def setTargetEntity(self, entity):
        self.unapplyEffect()
        self.m_targetEntity.removeEffect(self.m_name)
        self.m_targetEntity=entity
        entity.addEffect(self)
        self.applyEffect()

    # Called each frame to allow effect to make updates
    def frameUpdate(self, elapsedms, absolutems):
        pass

    # Apply this effect to target 
    def applyEffect(self):
        pass

    # Remove this effect from target
    def unapplyEffect(self):
        pass

